 package CurtainDesign;

 import CurtainDesign.utils.CalculateUtils;
 import CurtainDesign.utils.CurtainChecker;
 import CurtainDesign.utils.HingeRelatedInfo;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.Font;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
 import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.FocusEvent;
 import java.awt.event.FocusListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.WindowEvent;
 import java.awt.event.WindowListener;
 import java.text.DecimalFormat;
 import java.util.Vector;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import javax.swing.BorderFactory;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JTabbedPane;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
 import javax.swing.border.BevelBorder;
 import javax.swing.border.Border;
 import javax.swing.border.LineBorder;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.TableModelEvent;
 import javax.swing.event.TableModelListener;
 import javax.swing.table.TableColumn;
 import javax.swing.table.TableColumnModel;
 import pv.jfcx.JPVTable;
 import pv.jfcx.JPVTableView;
 import pv.jfcx.PVTableEditorListener;
 import pv.jfcx.PVTableModel;

 public class OrderInfoByFoldView extends OrderInfoView
 {
   protected JDialog m_DividerPosDlg;
   protected JDialog m_TotalAreaDlg;
   protected JComboBox m_WoodOptions = new JComboBox();

   protected JTextField m_WindowIndex = new JTextField("");

   protected JComboBox m_WindowNum = new JComboBox();

   protected JTextField m_Room = new JTextField("");

   protected JComboBox m_PanelNum = new JComboBox();

   protected JComboBox m_Install = new JComboBox();

   protected JComboBox m_FrameWidthNum = new JComboBox();

   protected JComboBox m_FrameHeightNum = new JComboBox();

   protected JComboBox m_PoleNum = new JComboBox();

   protected JComboBox m_DuiKouPoleNum = new JComboBox();

   protected JComboBox m_BeamType = new JComboBox();

   protected JComboBox m_DividerType = new JComboBox();

   protected JTextField m_Gap = new JTextField("");

   protected JComboBox m_DividerNum = new JComboBox();

   protected JTextField m_DividerPos = new JTextField("");

   protected JComboBox m_VaneType = new JComboBox();

   protected JComboBox m_PullBarType = new JComboBox();

   protected JButton m_InputTotalArea = new JButton("输入其它窗户尺寸");

   protected JTextArea m_Comments = new JTextArea("");
   protected JPVTableView m_CommentsView;
   protected PVTableModel m_CommentsTableModel;
   protected JPVTable m_CommentsTable;
   private JComboBox cb_BendHinge = new JComboBox();

   private JComboBox cb_MagnetType = new JComboBox();

   private JComboBox cb_ShuanglianPoleNum = new JComboBox();

   private JCheckBox chk_IsAutoAddDivider = new JCheckBox("自动添加分隔梁");

   private JCheckBox chk_Board = new JCheckBox("实木");

   public OrderInfoByFoldView()
   {
     try
     {
       jbInit();
     }
     catch (Exception e) {
       e.printStackTrace();
     }
   }

   public void jbInit()
   {
     this.m_JLabel = new JLabel[36];
     for (int i = 0; i < 36; i++) {
       this.m_JLabel[i] = new JLabel();
     }
     InitData();
     InitGenPaneLayout();
     InitWindowPaneLayout();
     InitPanelPaneLayout();
     InitCommentPaneLayout();
     InitListener();
     setLayout(new BorderLayout());
     this.m_Pane.setFont(new Font("Dialog", 0, 12));
     this.m_Pane.add("折叠形一般信息", this.m_GenInfoPane);
     this.m_Pane.add("窗户及外框信息", this.m_WindowInfoPane);
     this.m_Pane.add("扇信息", this.m_PanelPane);
     this.m_Pane.add("备注", this.m_CommentPane);
     add(this.m_Pane, "Center");
   }

   public void InitData()
   {
     Vector temp = new Vector();
     for (int i = 0; i < Constants.CLIENTREGION.length; i++) {
       temp.add(Constants.CLIENTREGION[i]);
       this.m_ClientRegion.addItem(temp.elementAt(i));
     }

     temp.removeAllElements();
     for (int i = 0; i < Constants.COLOR.length; i++) {
       temp.add(Constants.COLOR[i]);
       this.m_Color.addItem(temp.elementAt(i));
     }

     temp.removeAllElements();
     for (int i = 0; i < Constants.HINGECOLOR.length; i++) {
       temp.add(Constants.HINGECOLOR[i]);
       this.m_HingeColor.addItem(temp.elementAt(i));
     }
     temp.removeAllElements();
     for (int i = 0; i < Constants.WOODOPTION.length; i++) {
       temp.add(Constants.WOODOPTION[i]);
       this.m_WoodOptions.addItem(temp.elementAt(i));
     }
     temp.removeAllElements();
     for (int i = 0; i < Constants.MAGNET_TYPE.length; i++) {
       temp.add(Constants.MAGNET_TYPE[i]);
       this.cb_MagnetType.addItem(temp.elementAt(i));
     }
     temp.removeAllElements();
     for (int i = 0; i <= 12; i++) {
       temp.add("" + i);
       this.m_SingleHinge.addItem(temp.elementAt(i));
     }
     temp.removeAllElements();
     for (int i = 0; i <= 12; i++) {
       temp.add("" + i);
       this.m_DoubleHinge.addItem(temp.elementAt(i));
     }
     temp.removeAllElements();
     for (int i = 0; i <= 12; i++) {
       temp.add("" + i);
       this.cb_BendHinge.addItem(temp.elementAt(i));
     }

     temp.removeAllElements();
     for (int i = 0; i < 100; i++) {
       temp.add(i + 1 + "");
       this.m_WindowNum.addItem(temp.elementAt(i));
     }

     temp.removeAllElements();
     for (int i = 0; i < 12; i++) {
       temp.add(i + 1 + "");
       this.m_PanelNum.addItem(temp.elementAt(i));
     }

     temp.removeAllElements();
     int i = 0;
     for (int j = Constants.BYFOLD_HINGE_TYPES.length; i < j; i++) {
       temp.add(Constants.BYFOLD_HINGE_TYPES[i]);
       this.m_HingeInstallType.addItem(temp.elementAt(i));
     }

     temp.removeAllElements();
     for (int i1 = 0; i1 < Constants.INSTALL.length; i1++) {
       temp.add(Constants.INSTALL[i1]);
       this.m_Install.addItem(temp.elementAt(i1));
     }
     temp.removeAllElements();
     for (int i2 = 0; i2 < Constants.FRAMEWIDTHNUM.length; i2++) {
       temp.add(Constants.FRAMEWIDTHNUM[i2]);
       this.m_FrameWidthNum.addItem(temp.elementAt(i2));
     }
     temp.removeAllElements();
     for (int i3 = 0; i3 < Constants.FRAMEHEIGHTNUM.length; i3++) {
       temp.add(Constants.FRAMEHEIGHTNUM[i3]);
       this.m_FrameHeightNum.addItem(temp.elementAt(i3));
     }
     temp.removeAllElements();
     for (int i4 = 0; i4 < 24; i4++) {
       temp.add(i4 + 1 + "");
       this.m_PoleNum.addItem(temp.elementAt(i4));
     }
     temp.removeAllElements();
     for (int i5 = 0; i5 < 25; i5++) {
       temp.add(i5 + "");
       this.m_DuiKouPoleNum.addItem(temp.elementAt(i5));
     }
     temp.removeAllElements();
     for (int i6 = 0; i6 < 25; i6++) {
       temp.add(i6 + "");
       this.cb_ShuanglianPoleNum.addItem(temp.elementAt(i6));
     }
     temp.removeAllElements();
     for (int i7 = 0; i7 < Constants.VANETYPE.length; i7++) {
       temp.add(Constants.VANETYPE[i7]);
       this.m_VaneType.addItem(temp.elementAt(i7));
     }
     temp.removeAllElements();
     for (int i7 = 0; i7 < Constants.BEAMTYPE.length; i7++) {
       temp.add(Constants.BEAMTYPE[i7]);
       this.m_BeamType.addItem(temp.elementAt(i7));
     }
     temp.removeAllElements();
     for (int i8 = 0; i8 < Constants.PULLBARTYPE.length; i8++) {
       temp.add(Constants.PULLBARTYPE[i8]);
       this.m_PullBarType.addItem(temp.elementAt(i8));
     }
     temp.removeAllElements();
     for (int i9 = 0; i9 < 4; i9++) {
       temp.add(i9 + "");
       this.m_DividerNum.addItem(temp.elementAt(i9));
     }
     temp.removeAllElements();
     for (int i10 = 0; i10 < Constants.DIVIDERTYPE.length; i10++) {
       temp.add(Constants.DIVIDERTYPE[i10]);
       this.m_DividerType.addItem(temp.elementAt(i10));
     }

     CurtainDesign.m_PipeIndexFile.CreatePipeIndexFile(Constants.STYLES[1]);
   }

   public void InitGenPaneLayout()
   {
     GridBagLayout gbl = new GridBagLayout();
     GridBagConstraints gbc = new GridBagConstraints();
     this.m_GenInfoPane.setLayout(gbl);
     Border border = BorderFactory.createLineBorder(Color.gray, 2);
     this.m_GenInfoPane.setBorder(border);

     gbc.fill = 1;
     gbc.anchor = 13;
     gbc.insets = new Insets(15, 5, 15, 5);
     gbc.gridwidth = 1;

     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[0].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[0].setText("订单编号");
     this.m_JLabel[0].setToolTipText("Order Number");
     gbl.setConstraints(this.m_JLabel[0], gbc);
     this.m_GenInfoPane.add(this.m_JLabel[0]);

     gbc.gridwidth = 2;
     gbc.ipadx = 120;
     this.m_OrderIndex.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_OrderIndex.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOrderIndex());
     }
     gbl.setConstraints(this.m_OrderIndex, gbc);
     this.m_GenInfoPane.add(this.m_OrderIndex);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[1].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[1].setText("客户名称");
     this.m_JLabel[1].setToolTipText("Client Name");
     gbl.setConstraints(this.m_JLabel[1], gbc);
     this.m_GenInfoPane.add(this.m_JLabel[1]);

     gbc.gridwidth = 0;
     gbc.ipadx = 100;
     this.m_ClientRegion.setFont(new Font("Dialog", 0, 13));
     this.m_ClientRegion.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_ClientRegion.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetClientRegion());
     }
     gbl.setConstraints(this.m_ClientRegion, gbc);
     this.m_GenInfoPane.add(this.m_ClientRegion);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[4].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[4].setText("房间");
     this.m_JLabel[4].setToolTipText("Room");
     gbl.setConstraints(this.m_JLabel[4], gbc);
     this.m_GenInfoPane.add(this.m_JLabel[4]);

     gbc.gridwidth = 2;
     gbc.ipadx = 120;
     gbl.setConstraints(this.m_Room, gbc);
     this.m_Room.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_Room.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetRoom());
     }
     this.m_GenInfoPane.add(this.m_Room);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[5].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[5].setText("流水号");
     gbl.setConstraints(this.m_JLabel[5], gbc);
     this.m_GenInfoPane.add(this.m_JLabel[5]);

     gbc.gridwidth = 0;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_PipeIndex.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       String tmppipe = "";
       if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPipeIndex().equals(""))
       {
         tmppipe = CurtainDesign.m_PipeIndexFile.GetPipeIndex(Constants.STYLES[1], true);
       }
       else
       {
         tmppipe = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPipeIndex();
       }
       this.m_PipeIndex.setText(tmppipe);
       this.m_PipeIndex.setEditable(false);
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePipeIndex(tmppipe);
     }
     gbl.setConstraints(this.m_PipeIndex, gbc);
     this.m_GenInfoPane.add(this.m_PipeIndex);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[3].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[3].setText("下单日期");
     this.m_JLabel[3].setToolTipText("Order Date");
     gbl.setConstraints(this.m_JLabel[3], gbc);
     this.m_GenInfoPane.add(this.m_JLabel[3]);

     Border bodr = new BevelBorder(0, Color.lightGray, Color.white, Color.black, Color.gray);
     gbc.gridwidth = 1;
     gbc.ipadx = 120;
     gbc.ipady = 15;
     this.m_OrderDate.setName("OrderDate");
     this.m_OrderDate.setFont(new Font("Dialog", 0, 13));

     this.m_OrderDate.setBorder(bodr);
     gbl.setConstraints(this.m_OrderDate, gbc);
     this.m_GenInfoPane.add(this.m_OrderDate);

     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_OrderDate.setDate(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOrderDate());
     }

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_CustRefNumLabel.setFont(new Font("Dialog", 0, 13));
     this.m_CustRefNumLabel.setToolTipText("Customer Ref Num");
     gbl.setConstraints(this.m_CustRefNumLabel, gbc);
     this.m_GenInfoPane.add(this.m_CustRefNumLabel);

     gbc.gridwidth = 0;
     gbc.ipadx = 120;
     gbl.setConstraints(this.m_CustRefNum, gbc);
     this.m_CustRefNum.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_CustRefNum.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().getCustRefNum());
     }
     this.m_GenInfoPane.add(this.m_CustRefNum);
   }

   public void InitWindowPaneLayout()
   {
     GridBagLayout gbl = new GridBagLayout();
     GridBagConstraints gbc = new GridBagConstraints();
     this.m_WindowInfoPane.setLayout(gbl);
     Border border = BorderFactory.createLineBorder(Color.gray, 2);
     this.m_WindowInfoPane.setBorder(border);

     gbc.fill = 2;
     gbc.anchor = 13;
     gbc.insets = new Insets(15, 5, 15, 5);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[6].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[6].setText("窗户总数");
     this.m_JLabel[6].setToolTipText("Total Window Number");
     gbl.setConstraints(this.m_JLabel[6], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[6]);

     gbc.gridwidth = 2;
     gbc.ipadx = 80;
     this.m_WindowNum.setEditable(true);
     this.m_WindowNum.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       String windownum = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWindowNum();
       if ((windownum == null) || (windownum.equals(""))) {
         this.m_WindowNum.setSelectedIndex(-1);
       }
       else {
         this.m_WindowNum.setSelectedItem(windownum);
       }
     }
     gbl.setConstraints(this.m_WindowNum, gbc);
     this.m_WindowInfoPane.add(this.m_WindowNum);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[7].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[7].setText("窗户编号");
     this.m_JLabel[7].setToolTipText("No.of Window");
     gbl.setConstraints(this.m_JLabel[7], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[7]);

     gbc.gridwidth = 0;
     gbc.ipadx = 120;
     this.m_WindowIndex.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_WindowIndex.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWindowIndex());
     }
     gbl.setConstraints(this.m_WindowIndex, gbc);
     this.m_WindowInfoPane.add(this.m_WindowIndex);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[8].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[8].setText("木材选择");
     gbl.setConstraints(this.m_JLabel[8], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[8]);

     gbc.gridwidth = 2;
     gbc.ipadx = 10;
     gbc.ipady = 5;
     gbl.setConstraints(this.m_WoodOptions, gbc);
     this.m_WindowInfoPane.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_WoodOptions.setSelectedIndex(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWoodOption());
     }
     this.m_WindowInfoPane.add(this.m_WoodOptions);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[9].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[9].setText("颜色");
     this.m_JLabel[9].setToolTipText("Color");
     gbl.setConstraints(this.m_JLabel[9], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[9]);

     gbc.gridwidth = 0;
     gbc.ipadx = 120;
     this.m_Color.setFont(new Font("Dialog", 0, 13));
     if (!CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetColor())) {
       this.m_Color.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetColor());
     }
     else {
       this.m_Color.setSelectedIndex(-1);
     }
     gbl.setConstraints(this.m_Color, gbc);
     this.m_WindowInfoPane.add(this.m_Color);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[10].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[10].setText("窗户宽度(mm)");
     this.m_JLabel[10].setToolTipText("Width of Window");
     gbl.setConstraints(this.m_JLabel[10], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[10]);

     gbc.gridwidth = 2;
     gbc.ipadx = 70;
     gbl.setConstraints(this.m_OriWindowWidth, gbc);
     this.m_OriWindowWidth.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_OriWindowWidth.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOriWindowWidth());
     }
     this.m_WindowInfoPane.add(this.m_OriWindowWidth);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[11].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[11].setText("窗户高度(mm)");
     this.m_JLabel[11].setToolTipText("Height of Window");
     gbl.setConstraints(this.m_JLabel[11], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[11]);

     gbc.gridwidth = 0;
     gbc.ipadx = 120;
     gbl.setConstraints(this.m_OriWindowHeight, gbc);
     this.m_OriWindowHeight.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_OriWindowHeight.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOriWindowHeight());
     }
     this.m_WindowInfoPane.add(this.m_OriWindowHeight);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[12].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[12].setText("安装方式");
     this.m_JLabel[12].setToolTipText("Mount");
     gbl.setConstraints(this.m_JLabel[12], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[12]);

     gbc.gridwidth = 2;
     gbc.ipadx = 80;
     this.m_Install.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_Install.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetInstall());
     }
     gbl.setConstraints(this.m_Install, gbc);
     this.m_WindowInfoPane.add(this.m_Install);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[13].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[13].setText("合页颜色");
     this.m_JLabel[13].setToolTipText("Hinge Color");
     gbl.setConstraints(this.m_JLabel[13], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[13]);

     gbc.gridwidth = 0;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_HingeColor, gbc);
     this.m_HingeColor.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_HingeColor.setSelectedIndex(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetHingeColor());
     }
     this.m_WindowInfoPane.add(this.m_HingeColor);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[21].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[21].setText("拉杆类型");
     this.m_JLabel[21].setToolTipText("Type of Tilt Rod");
     gbl.setConstraints(this.m_JLabel[21], gbc);
     this.m_WindowInfoPane.add(this.m_JLabel[21]);

     gbc.gridwidth = 2;
     gbc.ipadx = 5;
     gbl.setConstraints(this.m_PullBarType, gbc);
     this.m_PullBarType.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_PullBarType.setSelectedIndex(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPullBarType());
     }
     this.m_WindowInfoPane.add(this.m_PullBarType);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     JLabel l_MagnetType = new JLabel("磁碰类型");
     l_MagnetType.setFont(new Font("Dialog", 0, 13));
     l_MagnetType.setToolTipText("Magnet Type");
     gbl.setConstraints(l_MagnetType, gbc);
     this.m_WindowInfoPane.add(l_MagnetType);

     gbc.gridwidth = 0;
     this.cb_MagnetType.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(this.cb_MagnetType, gbc);
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().IsRoundMagnet()) {
       this.cb_MagnetType.setSelectedItem(Constants.MAGNET_TYPE[0]);
     }

     this.m_WindowInfoPane.add(this.cb_MagnetType);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.chk_IsAutoAddDivider.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(this.chk_IsAutoAddDivider, gbc);
     this.m_WindowInfoPane.add(this.chk_IsAutoAddDivider);
     this.chk_IsAutoAddDivider.setSelected(CurtainDesign.m_UserMainGUI.GetOrderInfo().getAutoAddDivider());
   }

   public void InitPanelPaneLayout()
   {
     GridBagLayout gbl = new GridBagLayout();
     GridBagConstraints gbc = new GridBagConstraints();
     this.m_PanelPane.setLayout(gbl);
     Border border = BorderFactory.createLineBorder(Color.gray, 2);
     this.m_PanelPane.setBorder(border);

     gbc.fill = 1;
     gbc.anchor = 13;
     gbc.insets = new Insets(15, 5, 5, 5);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[14].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[14].setText("合页安装方式");
     this.m_JLabel[14].setToolTipText("Hinging");
     gbl.setConstraints(this.m_JLabel[14], gbc);
     this.m_PanelPane.add(this.m_JLabel[14]);

     gbc.gridwidth = 2;
     gbc.ipadx = 0;
     gbl.setConstraints(this.m_HingeInstallType, gbc);
     this.m_HingeInstallType.setFont(new Font("Dialog", 0, 13));
     this.m_HingeInstallType.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_HingeInstallType.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetHingeInstallType());
     }
     this.m_PanelPane.add(this.m_HingeInstallType);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[15].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[15].setText("窗户扇数");
     this.m_JLabel[15].setToolTipText("Panel Number");
     gbl.setConstraints(this.m_JLabel[15], gbc);
     this.m_PanelPane.add(this.m_JLabel[15]);

     gbc.gridwidth = 0;
     gbc.ipadx = 70;
     gbl.setConstraints(this.m_PanelNum, gbc);
     this.m_PanelNum.setFont(new Font("Dialog", 0, 13));
     this.m_PanelNum.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_PanelNum.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPanelNum());
     }
     this.m_PanelPane.add(this.m_PanelNum);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[16].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[16].setText("单开合页扇数");
     gbl.setConstraints(this.m_JLabel[16], gbc);
     this.m_PanelPane.add(this.m_JLabel[16]);

     gbc.gridwidth = 2;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_SingleHinge, gbc);
     this.m_SingleHinge.setFont(new Font("Dialog", 0, 13));
     this.m_SingleHinge.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_SingleHinge.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetSingleHinge());
     }
     this.m_PanelPane.add(this.m_SingleHinge);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[17].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[17].setText("双开合页扇数");
     gbl.setConstraints(this.m_JLabel[17], gbc);
     this.m_PanelPane.add(this.m_JLabel[17]);

     gbc.gridwidth = 0;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_DoubleHinge, gbc);
     this.m_DoubleHinge.setFont(new Font("Dialog", 0, 13));
     this.m_DoubleHinge.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_DoubleHinge.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDoubleHinge());
     }
     this.m_PanelPane.add(this.m_DoubleHinge);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     JLabel l_BendHinge = new JLabel("弯曲合页扇数");
     l_BendHinge.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(l_BendHinge, gbc);
     this.m_PanelPane.add(l_BendHinge);

     gbc.gridwidth = 2;
     this.cb_BendHinge.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(this.cb_BendHinge, gbc);
     this.m_PanelPane.add(this.cb_BendHinge);
     if (!CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().getBendHinge())) {
       this.cb_BendHinge.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().getBendHinge());
     }

     gbc.gridwidth = -1;
     JLabel l_ShuanglianPoleNum = new JLabel("双连立杆数");
     l_ShuanglianPoleNum.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(l_ShuanglianPoleNum, gbc);
     this.m_PanelPane.add(l_ShuanglianPoleNum);

     gbc.gridwidth = 0;
     this.cb_ShuanglianPoleNum.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(this.cb_ShuanglianPoleNum, gbc);
     this.m_PanelPane.add(this.cb_ShuanglianPoleNum);
     if (!CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().getShuangLianPoleNum())) {
       this.cb_ShuanglianPoleNum.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().getShuangLianPoleNum());
     }

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[18].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[18].setText("立杆数量");
     this.m_JLabel[18].setToolTipText("Q'ty of Stiles");
     gbl.setConstraints(this.m_JLabel[18], gbc);
     this.m_PanelPane.add(this.m_JLabel[18]);

     gbc.gridwidth = 2;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_PoleNum, gbc);
     this.m_PoleNum.setFont(new Font("Dialog", 0, 13));
     this.m_PoleNum.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_PoleNum.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPoleNum());
     }
     this.m_PanelPane.add(this.m_PoleNum);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[19].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[19].setText("对口立杆数量");
     this.m_JLabel[19].setToolTipText("Q'ty of Rabbit Stiles");
     gbl.setConstraints(this.m_JLabel[19], gbc);
     this.m_PanelPane.add(this.m_JLabel[19]);

     gbc.gridwidth = 0;
     gbc.ipadx = 60;
     gbl.setConstraints(this.m_DuiKouPoleNum, gbc);
     this.m_DuiKouPoleNum.setFont(new Font("Dialog", 0, 13));
     this.m_DuiKouPoleNum.setEditable(true);
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_DuiKouPoleNum.setSelectedItem(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDuiKouPoleNum());
     }
     this.m_PanelPane.add(this.m_DuiKouPoleNum);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     this.m_JLabel[20].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[20].setText("水平间隙(mm)");
     this.m_JLabel[20].setToolTipText("Horizontal Gap");
     gbl.setConstraints(this.m_JLabel[20], gbc);
     this.m_PanelPane.add(this.m_JLabel[20]);

     gbc.gridwidth = 2;
     gbc.ipadx = 100;
     gbl.setConstraints(this.m_Gap, gbc);
     this.m_Gap.setFont(new Font("Dialog", 0, 13));
     this.m_PanelPane.add(this.m_Gap);
     if (!CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetGap())) {
       this.m_Gap.setText(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetGap());
     }

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.chk_Board.setFont(new Font("Dialog", 0, 13));
     gbl.setConstraints(this.chk_Board, gbc);
     this.m_PanelPane.add(this.chk_Board);
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().getIsBoard())
     {
       this.chk_Board.setSelected(true);

       this.m_VaneType.setSelectedIndex(-1);
       this.m_VaneType.setEnabled(false);
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveVaneType(-1);

       this.m_PullBarType.setSelectedIndex(-1);
       this.m_PullBarType.setEnabled(false);
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePullBarType(-1);

       this.m_DividerType.setSelectedIndex(-1);
       this.m_DividerType.setEnabled(false);
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(-1);

       this.m_DividerNum.setSelectedIndex(-1);
       this.m_DividerNum.setEnabled(false);
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerNum("0");

       this.m_DividerPos.setText("");
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerPos("");
     }
     else
     {
       this.m_VaneType.setEnabled(true);
       this.m_PullBarType.setEnabled(true);
       this.m_DividerNum.setEnabled(true);
       this.m_PullBarType.setEnabled(true);
     }

     gbc.gridwidth = 0;
     gbc.ipadx = 60;
     JLabel blankLabel = new JLabel("");
     gbl.setConstraints(blankLabel, gbc);
     this.m_PanelPane.add(blankLabel);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[22].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[22].setText("叶片规格(mm)");
     this.m_JLabel[22].setToolTipText("Louver Size");
     gbl.setConstraints(this.m_JLabel[22], gbc);
     this.m_PanelPane.add(this.m_JLabel[22]);

     gbc.gridwidth = 2;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_VaneType, gbc);
     this.m_VaneType.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       this.m_VaneType.setSelectedIndex(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetVaneType());
     }
     this.m_PanelPane.add(this.m_VaneType);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[23].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[23].setText("分隔梁规格(mm)");
     this.m_JLabel[23].setToolTipText("Divider Size");
     gbl.setConstraints(this.m_JLabel[23], gbc);
     this.m_PanelPane.add(this.m_JLabel[23]);

     gbc.gridwidth = 0;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_DividerType, gbc);
     this.m_DividerType.setFont(new Font("Dialog", 0, 13));
     if ((!CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum().equals("")) && (!CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum().equals("0")) && (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetVaneType() > -1))
     {
       int vanetype = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetVaneType();
       this.m_DividerType.removeAllItems();
       Vector vector = new Vector();
       int dividerArrayPos = 0;
       if (vanetype == 3)
       {
         dividerArrayPos = 1;
       }
       else if ((vanetype == 0) || (vanetype == 2)) {
         dividerArrayPos = 2;
       }
       else if (vanetype == 4) {
         dividerArrayPos = 3;
       }
       this.m_DividerType.removeAllItems();
       vector.add(Constants.DIVIDERTYPE[dividerArrayPos]);
       this.m_DividerType.addItem(vector.elementAt(0));
       this.m_DividerType.setSelectedIndex(0);
     }
     else {
       this.m_DividerType.setEnabled(false);
       this.m_DividerType.setSelectedIndex(-1);
     }
     this.m_PanelPane.add(this.m_DividerType);

     gbc.gridwidth = 1;
     gbc.ipadx = 5;
     this.m_JLabel[24].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[24].setText("分隔梁数量");
     this.m_JLabel[24].setToolTipText("Divider Number for each Panel");
     gbl.setConstraints(this.m_JLabel[24], gbc);
     this.m_PanelPane.add(this.m_JLabel[24]);

     gbc.gridwidth = 2;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_DividerNum, gbc);
     this.m_DividerNum.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       String divnum = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum();
       if (divnum.equals("")) {
         this.m_DividerNum.setSelectedIndex(-1);
       }
       else {
         this.m_DividerNum.setSelectedItem(divnum);
       }
     }

     this.m_PanelPane.add(this.m_DividerNum);

     gbc.gridwidth = -1;
     gbc.ipadx = 5;
     this.m_JLabel[25].setFont(new Font("Dialog", 0, 13));
     this.m_JLabel[25].setText("分隔梁位置(mm)");
     this.m_JLabel[25].setToolTipText("Divider Location");
     gbl.setConstraints(this.m_JLabel[25], gbc);
     this.m_PanelPane.add(this.m_JLabel[25]);

     gbc.gridwidth = 0;
     gbc.ipadx = 80;
     gbl.setConstraints(this.m_DividerPos, gbc);
     this.m_DividerPos.setFont(new Font("Dialog", 0, 13));
     if (CurtainDesign.m_UserMainGUI != null) {
       String temp = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDivederPos();
       this.m_DividerPos.setText(temp);
     }
     this.m_DividerPos.setEditable(false);
     this.m_PanelPane.add(this.m_DividerPos);
   }

   public void InitCommentPaneLayout()
   {
     Border border = BorderFactory.createLineBorder(Color.gray, 5);
     this.m_CommentPane.setBorder(border);
     this.m_CommentPane.setLayout(new BorderLayout());
     InitCommentsTable();
     this.m_CommentPane.add(this.m_CommentsView);
   }

   public void InitCommentsTable()
   {
     this.m_CommentsTableModel = new PVTableModel(BuildRows(), BuildCols());
     this.m_CommentsTable = new JPVTable(this.m_CommentsTableModel);
     this.m_CommentsTable.setAutoResizeMode(4);

     int[] staticlist = new int[Constants.TABLESIZE[1]];
     for (int i = 0; i < Constants.TABLESIZE[1]; i++) {
       staticlist[i] = i;
     }
     this.m_CommentsTable.setListOfStaticColumns(staticlist);
     this.m_CommentsView = new JPVTableView(this.m_CommentsTable);

     this.m_CommentsView.setRowHeight(25);
     this.m_CommentsView.setBorderStyle(18);
     this.m_CommentsView.setFirstColumnStyle(1);
     Color clr = new Color(-6250272);
     Border bodr = new BevelBorder(0, Color.lightGray, Color.white, Color.black, Color.gray);
     this.m_CommentsView.setBorderColor(clr);
     this.m_CommentsView.setHeaderMultiLine(1);
     this.m_CommentsView.setHeaderBackground(clr);
     this.m_CommentsView.setHeaderBorder(bodr);
     this.m_CommentsView.setHeaderBorderPressed(new BevelBorder(1, Color.lightGray, Color.white, Color.black, Color.gray));
     this.m_CommentsView.setHeaderAlignment(0);
     this.m_CommentsView.setHeaderFont(new Font("宋体", 0, 15));

     for (int i = 0; i < Constants.TABLESIZE[1]; i++) {
       this.m_CommentsView.setColumnFont(i, new Font("宋体", 0, 13));
     }

     this.m_CommentsView.setUpdateTableInRealTime(true);
     this.m_CommentsView.setGridColor(Color.darkGray);
     this.m_CommentsView.setFocusCellBorder(new LineBorder(Color.green, 2));
     this.m_CommentsView.setFocusCellForeground(new Color(-3856));
     this.m_CommentsView.setFocusCellBackground(new Color(-10460976));
     this.m_CommentsView.setSelectionForeground(new Color(-16713737));
     this.m_CommentsView.setSelectionBackground(new Color(-7302928));
     this.m_CommentsView.setEditMode(0);
     this.m_CommentsView.addEditorListener(new PVTableEditorListener()
     {
       public boolean beforeStart(ChangeEvent e)
       {
         return true;
       }

       public void started(ChangeEvent e)
       {
       }

       public void editingStopped(ChangeEvent e)
       {
         String comments = "";

         String cell_comment = "";
         for (int i = 0; i < OrderInfoByFoldView.this.m_CommentsTableModel.getRowCount(); i++) {
           Vector row_comment = OrderInfoByFoldView.this.m_CommentsTableModel.getRowData(i);
           for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++) {
             cell_comment = (String)row_comment.elementAt(j);
             comments = comments + cell_comment;
             comments = comments + "@@";
           }
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveComments(comments);
       }
     });
     this.m_CommentsView.addTableModelListener(new TableModelListener()
     {
       public void tableChanged(TableModelEvent e)
       {
         String comments = "";

         String cell_comment = "";
         for (int i = 0; i < OrderInfoByFoldView.this.m_CommentsTableModel.getRowCount(); i++) {
           Vector row_comment = OrderInfoByFoldView.this.m_CommentsTableModel.getRowData(i);
           if (row_comment == null)
           {
             row_comment = new Vector(Constants.TABLESIZE[1] - 1);
             for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++) {
               row_comment.addElement("");
             }
             OrderInfoByFoldView.this.m_CommentsTableModel.setRowData(row_comment, i);
           }
           for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++) {
             cell_comment = (String)row_comment.elementAt(j);
             comments = comments + cell_comment;
             comments = comments + "@@";
           }
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveComments(comments);
       }
     });
     for (int i = 1; i < Constants.TABLESIZE[1]; i++) {
       TableColumn column = this.m_CommentsTable.getColumnModel().getColumn(i);
       column.setPreferredWidth(300);
     }
     this.m_CommentsView.setEnableDeleteKey(true);
     this.m_CommentsView.setEnableInsertKey(true);
     this.m_CommentsView.setEnableSortData(false);
   }

   private Vector BuildCols()
   {
     Vector cols = new Vector(Constants.TABLESIZE[1]);
     cols.addElement("编号");
     for (int i = 1; i < Constants.TABLESIZE[1]; i++) {
       cols.addElement("注释" + i);
     }
     return cols;
   }

   private Vector BuildRows()
   {
     Vector data = new Vector();

     String comments = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetComments();
     if (CurtainChecker.isEmpty(comments))
     {
       for (int i = 0; i < Constants.TABLESIZE[0]; i++) {
         Vector row = new Vector(Constants.TABLESIZE[1] - 1);
         for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++) {
           row.addElement("");
         }
         data.addElement(row);
       }
     }
     else
     {
       String strComments = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetComments();
       String[] commentArray = strComments.split("@@");
		 int rowNum = commentArray.length % (Constants.TABLESIZE[1] - 1) == 0 ? commentArray.length / (Constants.TABLESIZE[1] - 1) : commentArray.length / (Constants.TABLESIZE[1] - 1) + 1;

       for (int i = 0; i < rowNum; i++) {
         String[] cell_comments = new String[Constants.TABLESIZE[1] - 1];
         for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++) {
           cell_comments[j] = "";
         }

         for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++) {
           if (i * (Constants.TABLESIZE[1] - 1) + j < commentArray.length) {
             cell_comments[j] = commentArray[(i * (Constants.TABLESIZE[1] - 1) + j)];
           }
         }

         Vector row_vector = null;
         row_vector = new Vector();
         for (int j = 0; j < cell_comments.length; j++) {
           row_vector.addElement(cell_comments[j]);
         }
         data.addElement(row_vector);
       }
     }

     return data;
   }

   public void InitListener()
   {
     initGenTabListener();
     initWindowTabListener();
     initWindowTabListener();
     initPanelTabListener();
     initCommentsTabListener();
   }

   private void initGenTabListener()
   {
     this.m_OrderIndex.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_OrderIndex.getText();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveOrderIndex(str);
         CurtainDesign.m_UserMainGUI.DisableSaveBt();
         CurtainDesign.m_UserMainGUI.EnableSaveAsBt();
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.m_ClientRegion.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveClientRegion((String)b.getSelectedItem());
         CurtainDesign.m_UserMainGUI.DisableSaveBt();
         CurtainDesign.m_UserMainGUI.EnableSaveAsBt();
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_Room.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_Room.getText();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveRoom(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.m_PipeIndex.addKeyListener(new KeyListener()
     {
       Pattern numpattern = Pattern.compile("\\d*");

       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_PipeIndex.getText();
         Matcher m = this.numpattern.matcher(str);
         if (!m.matches()) {
           OrderInfoByFoldView.this.getToolkit().beep();
           e.consume();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = str.substring(0, str.length() - 1);
           OrderInfoByFoldView.this.m_PipeIndex.setText(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePipeIndex(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.m_CustRefNum.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_CustRefNum.getText().trim();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().saveCustRefNum(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
   }

   private void initWindowTabListener()
   {
     this.m_WindowNum.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         if (OrderInfoByFoldView.this.m_WindowNum.getSelectedItem() == null) {
           return;
         }
         if ((!CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOtherHeight().equals("")) && (!CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOtherWidth().equals("")) && (!CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWindowNum().equals(""))) {
           JOptionPane.showMessageDialog(CurtainDesign.m_UserMainGUI, "请注意,这将丢失已输入的其它窗户尺寸!");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveOtherHeight("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveOtherWidth("");
         }

         if (((String)(String)OrderInfoByFoldView.this.m_WindowNum.getSelectedItem()).equals("")) {
           OrderInfoByFoldView.this.m_InputTotalArea.setEnabled(false);
           return;
         }
         if (((String)(String)OrderInfoByFoldView.this.m_WindowNum.getSelectedItem()).equals("1")) {
           OrderInfoByFoldView.this.m_InputTotalArea.setEnabled(false);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowNum((String)b.getSelectedItem());
         } else {
           if (OrderInfoByFoldView.this.m_WindowIndex.getText().equals("")) {
             OrderInfoByFoldView.this.m_InputTotalArea.setEnabled(true);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowNum((String)b.getSelectedItem());
             return;
           }

           OrderInfoByFoldView.this.m_InputTotalArea.setEnabled(true);
         }

         Integer tmp1 = new Integer((String)OrderInfoByFoldView.this.m_WindowNum.getSelectedItem());
         if (OrderInfoByFoldView.this.m_WindowIndex.getText().trim().equals("")) {
           return;
         }

         Integer tmp2 = new Integer(OrderInfoByFoldView.this.m_WindowIndex.getText().trim());
         if (tmp1.compareTo(tmp2) < 0) {
           JOptionPane.showMessageDialog(null, "窗户总数不得小于窗户编号", "错误", 0);
           OrderInfoByFoldView.this.m_WindowNum.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_WindowIndex.setText("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowIndex("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowNum("");
           OrderInfoByFoldView.this.m_InputTotalArea.setEnabled(false);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowNum((String)b.getSelectedItem());
         CurtainDesign.m_UserMainGUI.DisableSaveBt();
         CurtainDesign.m_UserMainGUI.EnableSaveAsBt();
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_WindowIndex.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_WindowIndex.getText();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           e.consume();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = str.substring(0, str.length() - 1);
           OrderInfoByFoldView.this.m_WindowIndex.setText(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowIndex(str);
         CurtainDesign.m_UserMainGUI.DisableSaveBt();
         CurtainDesign.m_UserMainGUI.EnableSaveAsBt();
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.m_WindowIndex.addFocusListener(new FocusListener()
     {
       public void focusGained(FocusEvent e)
       {
       }

       public void focusLost(FocusEvent e)
       {
         if (OrderInfoByFoldView.this.m_WindowNum.getSelectedItem() == null) {
           return;
         }
         if (OrderInfoByFoldView.this.m_WindowIndex.getText().equals("")) {
           return;
         }
         Integer tmp1 = new Integer((String)OrderInfoByFoldView.this.m_WindowNum.getSelectedItem());
         if (OrderInfoByFoldView.this.m_WindowIndex.getText().trim().equals("")) {
           return;
         }
         Integer tmp2 = new Integer(OrderInfoByFoldView.this.m_WindowIndex.getText().trim());
         if (tmp1.compareTo(tmp2) < 0) {
           JOptionPane.showMessageDialog(null, "窗户总数不得小于窗户编号", "错误", 0);
           OrderInfoByFoldView.this.m_WindowNum.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_WindowIndex.setText("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowIndex("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowNum("");
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_WindowIndex.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
         if (OrderInfoByFoldView.this.m_WindowNum.getSelectedItem() == null) {
           return;
         }
         if (OrderInfoByFoldView.this.m_WindowIndex.getText().equals("")) {
           return;
         }

         Integer tmp1 = new Integer((String)OrderInfoByFoldView.this.m_WindowNum.getSelectedItem());
         if (OrderInfoByFoldView.this.m_WindowIndex.getText().trim().equals("")) {
           return;
         }

         Integer tmp2 = new Integer(OrderInfoByFoldView.this.m_WindowIndex.getText().trim());

         if (tmp1.compareTo(tmp2) < 0) {
           JOptionPane.showMessageDialog(null, "窗户总数不得小于窗户编号", "错误", 0);
           OrderInfoByFoldView.this.m_WindowNum.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_WindowIndex.setText("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowIndex("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWindowNum("");
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_WoodOptions.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveWoodOption(b.getSelectedIndex());
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_Color.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveColor((String)b.getSelectedItem());
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_OriWindowWidth.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_OriWindowWidth.getText();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           e.consume();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = str.substring(0, str.length() - 1);
           OrderInfoByFoldView.this.m_OriWindowWidth.setText(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveOriWindowWidth(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.m_OriWindowHeight.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_OriWindowHeight.getText();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           e.consume();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = str.substring(0, str.length() - 1);
           OrderInfoByFoldView.this.m_OriWindowHeight.setText(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveOriWindowHeight(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.m_Install.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveInstall((String)b.getSelectedItem());
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_HingeColor.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveHingeColor(b.getSelectedIndex());
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_PullBarType.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePullBarType(b.getSelectedIndex());
         if ((OrderInfoByFoldView.this.m_VaneType.getSelectedIndex() == 4) && (OrderInfoByFoldView.this.m_PullBarType.getSelectedIndex() == 1))
         {
           OrderInfoByFoldView.this.m_VaneType.setSelectedIndex(-1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveVaneType(OrderInfoByFoldView.this.m_VaneType.getSelectedIndex());
           OrderInfoByFoldView.this.m_PullBarType.setSelectedIndex(-1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePullBarType(OrderInfoByFoldView.this.m_PullBarType.getSelectedIndex());
           JOptionPane.showMessageDialog(null, "31mm不能选择隐式拉杆", "错误", 0);
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.cb_MagnetType.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         if (((String)OrderInfoByFoldView.this.cb_MagnetType.getSelectedItem()).equalsIgnoreCase(Constants.MAGNET_TYPE[0])) {
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveIsRoundMagnet(true);
         }
         else {
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveIsRoundMagnet(false);
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.chk_IsAutoAddDivider.addChangeListener(new ChangeListener()
     {
       public void stateChanged(ChangeEvent arg0)
       {
         if (OrderInfoByFoldView.this.chk_IsAutoAddDivider.isSelected()) {
           CurtainDesign.m_UserMainGUI.GetOrderInfo().saveAutoAddDivider(true);
         }
         else {
           CurtainDesign.m_UserMainGUI.GetOrderInfo().saveAutoAddDivider(false);
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
   }

   private void initPanelTabListener()
   {
   	// 合页安装方式
     this.m_HingeInstallType.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String hingeInstall = (String)b.getSelectedItem();

         if ((CurtainChecker.isEmpty(hingeInstall)) && (e.getStateChange() != 1)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请输入或者选择合页安装方式！", "错误", 0);

           OrderInfoByFoldView.this.m_HingeInstallType.setSelectedItem("");
           OrderInfoByFoldView.this.m_SingleHinge.setSelectedItem("");
           OrderInfoByFoldView.this.m_DoubleHinge.setSelectedItem("");
           OrderInfoByFoldView.this.cb_BendHinge.setSelectedItem("");
           OrderInfoByFoldView.this.m_PanelNum.setSelectedItem("");
           OrderInfoByFoldView.this.m_PoleNum.setSelectedItem("");
           OrderInfoByFoldView.this.m_DuiKouPoleNum.setSelectedItem("");
           OrderInfoByFoldView.this.cb_ShuanglianPoleNum.setSelectedItem("");
           OrderInfoByFoldView.this.m_Gap.setText("");
           OrderInfoByFoldView.this.CheckCalcBt();
           return;
         }

         String[] tempArray = hingeInstall.split(":");
         if (tempArray.length == 2) {
           hingeInstall = tempArray[1];
         }

         if (e.getStateChange() == 2L)
         {
           hingeInstall = CalculateUtils.formatHingeInstallType(hingeInstall);
           if (!CurtainChecker.isVaildByFoldNum(hingeInstall)) {
             OrderInfoByFoldView.this.getToolkit().beep();
             JOptionPane.showMessageDialog(null, "窗扇数量必须为偶数！", "错误", 0);
             OrderInfoByFoldView.this.CheckCalcBt();
             return;
           }
           if (!CurtainChecker.isVaildHingeInstall(hingeInstall, CurtainChecker.byFoldRegex)) {
             OrderInfoByFoldView.this.getToolkit().beep();
             JOptionPane.showMessageDialog(null, "您输入的合页安装方式不合法，请重新输入！", "错误", 0);

             OrderInfoByFoldView.this.m_SingleHinge.setSelectedItem("");
             OrderInfoByFoldView.this.m_DoubleHinge.setSelectedItem("");
             OrderInfoByFoldView.this.cb_BendHinge.setSelectedItem("");
             OrderInfoByFoldView.this.m_PanelNum.setSelectedItem("");
             OrderInfoByFoldView.this.m_PoleNum.setSelectedItem("");
             OrderInfoByFoldView.this.m_DuiKouPoleNum.setSelectedItem("");
             OrderInfoByFoldView.this.cb_ShuanglianPoleNum.setSelectedItem("");
             OrderInfoByFoldView.this.m_Gap.setText("");
             OrderInfoByFoldView.this.CheckCalcBt();
             return;
           }

           HingeRelatedInfo info = CalculateUtils.getByFoldHingeRelatedInfo(hingeInstall);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveHingeInstallType(hingeInstall);

           OrderInfoByFoldView.this.m_PanelNum.setSelectedIndex(info.getPaneNum() - 1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePanelNum(new Integer(info.getPaneNum()).toString());

           OrderInfoByFoldView.this.cb_BendHinge.setSelectedIndex(info.getBendHingePaneNum());
           CurtainDesign.m_UserMainGUI.GetOrderInfo().saveBendHinge(new Integer(info.getBendHingePaneNum()).toString());

           OrderInfoByFoldView.this.m_SingleHinge.setSelectedIndex(info.getSingleHingePaneNum());
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveSingleHinge(new Integer(info.getSingleHingePaneNum()).toString());

           OrderInfoByFoldView.this.m_DoubleHinge.setSelectedIndex(info.getDoubleHingePaneNum());
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDoubleHinge(new Integer(info.getDoubleHingePaneNum()).toString());

           OrderInfoByFoldView.this.m_PoleNum.setSelectedIndex(info.getPoleNum() - 1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePoleNum(new Integer(info.getPoleNum()).toString());

           OrderInfoByFoldView.this.m_DuiKouPoleNum.setSelectedIndex(info.getDuikouPoleNum());
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDuiKouPoleNum(new Integer(info.getDuikouPoleNum()).toString());

           OrderInfoByFoldView.this.cb_ShuanglianPoleNum.setSelectedIndex(info.getShuanglianPoleNum());
           CurtainDesign.m_UserMainGUI.GetOrderInfo().saveShuangLianPoleNum(new Integer(info.getShuanglianPoleNum()).toString());

           DecimalFormat nFormat = new DecimalFormat();
           nFormat.setMaximumFractionDigits(2);
           nFormat.setGroupingSize(10);
           OrderInfoByFoldView.this.m_Gap.setText(nFormat.format(info.getGap()));
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveGap(nFormat.format(info.getGap()));

           OrderInfoByFoldView.this.CheckCalcBt();
         }
       }
     });
     this.m_PanelNum.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePanelNum(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_SingleHinge.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveSingleHinge(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_DoubleHinge.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDoubleHinge(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.cb_BendHinge.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().saveBendHinge(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.cb_ShuanglianPoleNum.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().saveShuangLianPoleNum(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_PoleNum.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePoleNum(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_DuiKouPoleNum.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         String str = (String)b.getSelectedItem();
         if (!CurtainChecker.isInteger(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = "";
           b.setSelectedItem(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDuiKouPoleNum(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_Gap.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         String str = OrderInfoByFoldView.this.m_Gap.getText();
         if (!CurtainChecker.isNumber(str)) {
           OrderInfoByFoldView.this.getToolkit().beep();
           e.consume();
           JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
           str = str.substring(0, str.length() - 1);
           OrderInfoByFoldView.this.m_Gap.setText(str);
         }
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveGap(str);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
     this.chk_Board.addChangeListener(new ChangeListener()
     {
       public void stateChanged(ChangeEvent arg)
       {
         JCheckBox chk = (JCheckBox)arg.getSource();
         if (chk.isSelected())
         {
           CurtainDesign.m_UserMainGUI.GetOrderInfo().saveIsBoard(true);

           OrderInfoByFoldView.this.m_VaneType.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_VaneType.setEnabled(false);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveVaneType(-1);

           OrderInfoByFoldView.this.m_PullBarType.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_PullBarType.setEnabled(false);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePullBarType(-1);

           OrderInfoByFoldView.this.m_DividerType.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_DividerType.setEnabled(false);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(-1);

           OrderInfoByFoldView.this.m_DividerNum.setSelectedIndex(-1);
           OrderInfoByFoldView.this.m_DividerNum.setEnabled(false);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerNum("0");

           OrderInfoByFoldView.this.m_DividerPos.setText("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerPos("");
         }
         else {
           CurtainDesign.m_UserMainGUI.GetOrderInfo().saveIsBoard(false);
           OrderInfoByFoldView.this.m_VaneType.setEnabled(true);
           OrderInfoByFoldView.this.m_PullBarType.setEnabled(true);
           OrderInfoByFoldView.this.m_DividerNum.setEnabled(true);
           OrderInfoByFoldView.this.m_PullBarType.setEnabled(true);
         }
         CurtainDesign.m_UserMainGUI.DisableSaveBt();
         CurtainDesign.m_UserMainGUI.EnableSaveAsBt();
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_VaneType.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveVaneType(b.getSelectedIndex());
         if ((OrderInfoByFoldView.this.m_VaneType.getSelectedIndex() == 4) && (OrderInfoByFoldView.this.m_PullBarType.getSelectedIndex() == 1))
         {
           OrderInfoByFoldView.this.m_VaneType.setSelectedIndex(-1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveVaneType(OrderInfoByFoldView.this.m_VaneType.getSelectedIndex());
           OrderInfoByFoldView.this.m_PullBarType.setSelectedIndex(-1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SavePullBarType(OrderInfoByFoldView.this.m_PullBarType.getSelectedIndex());
           JOptionPane.showMessageDialog(null, "31mm不能选择隐式拉杆", "错误", 0);
         }

         if ((OrderInfoByFoldView.this.m_DividerNum.getSelectedItem() != null) && (!OrderInfoByFoldView.this.m_DividerNum.getSelectedItem().equals("")) && (!OrderInfoByFoldView.this.m_DividerNum.getSelectedItem().equals("0")))
         {
           int vanetype = b.getSelectedIndex();
           if ((vanetype == 0) || (vanetype == 2)) {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[2]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(2);
           }
           else if (vanetype == 1) {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[0]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(0);
           }
           else if (vanetype == 3)
           {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[1]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(1);
           }
           else
           {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[3]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(3);
           }
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_DividerType.addItemListener(new ItemListener()
     {
       public void itemStateChanged(ItemEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         if (b.getSelectedIndex() != -1) {
           for (int i = 0; i < Constants.DIVIDERTYPE.length; i++) {
             if (((String)b.getSelectedItem()).equals(Constants.DIVIDERTYPE[i])) {
               CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(i);
             }
           }
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_DividerNum.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
         JComboBox b = (JComboBox)e.getSource();
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerNum((String)b.getSelectedItem());
         if ((b.getSelectedItem() != null) && (!((String)b.getSelectedItem()).equals("")) && (!((String)b.getSelectedItem()).equals("0")))
         {
           OrderInfoByFoldView.this.m_DividerType.setEnabled(true);
           OrderInfoByFoldView.this.m_DividerPos.setText("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerPos("");
           int vanetype = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetVaneType();
           OrderInfoByFoldView.this.m_DividerType.removeAllItems();
           if ((vanetype == 0) || (vanetype == 2)) {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[2]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(2);
           }
           else if (vanetype == 1) {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[0]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(0);
           }
           else if (vanetype == 3)
           {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[1]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(1);
           }
           else
           {
             OrderInfoByFoldView.this.m_DividerType.removeAllItems();
             OrderInfoByFoldView.this.m_DividerType.addItem(Constants.DIVIDERTYPE[3]);
             CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(3);
           }
           OrderInfoByFoldView.this.InputDividerPosDlg(true);
         }
         else
         {
           OrderInfoByFoldView.this.m_DividerPos.setText("");
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerPos("");
           OrderInfoByFoldView.this.m_DividerType.setSelectedIndex(-1);
           CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerType(-1);
           OrderInfoByFoldView.this.m_DividerType.setEnabled(false);
         }
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
     this.m_DividerPos.addMouseListener(new MouseListener()
     {
       public void mouseClicked(MouseEvent e)
       {
         OrderInfoByFoldView.this.InputDividerPosDlg(false);
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void mouseEntered(MouseEvent e)
       {
       }

       public void mouseExited(MouseEvent e)
       {
       }

       public void mousePressed(MouseEvent e)
       {
       }

       public void mouseReleased(MouseEvent e)
       {
       }
     });
   }

   private void initCommentsTabListener()
   {
     this.m_Comments.addMouseListener(new MouseListener()
     {
       public void mouseClicked(MouseEvent e)
       {
         ((JTextArea)e.getSource()).setText("");
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void mouseEntered(MouseEvent e)
       {
       }

       public void mouseExited(MouseEvent e)
       {
       }

       public void mousePressed(MouseEvent e)
       {
       }

       public void mouseReleased(MouseEvent e)
       {
       }
     });
     this.m_Comments.addKeyListener(new KeyListener()
     {
       public void keyTyped(KeyEvent e)
       {
       }

       public void keyReleased(KeyEvent e)
       {
         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveComments(((JTextArea)e.getSource()).getText());
         OrderInfoByFoldView.this.CheckCalcBt();
       }

       public void keyPressed(KeyEvent e)
       {
       }
     });
   }

   public void CheckCalcBt()
   {
     if (IsInfoComplete()) {
       CurtainDesign.m_UserMainGUI.EnableCalcBt();
     }
     else
       CurtainDesign.m_UserMainGUI.DisableCalcBt();
   }

   public boolean IsInfoComplete()
   {
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOrderIndex()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetClientRegion()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetRoom()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPipeIndex()))
     {
       return false;
     }
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOrderDate() == null)
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetColor()))
     {
       return false;
     }
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetSingleHinge().equals(""))
     {
       return false;
     }
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetHingeColor() == -1)
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetHingeInstallType()))
     {
       return false;
     }
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWoodOption() == -1)
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWindowIndex()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetWindowNum()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOriWindowWidth()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOriWindowHeight()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPanelNum()))
     {
       return false;
     }
     if (CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetGap()))
     {
       return false;
     }
     if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPoleNum().equals(""))
     {
       return false;
     }
     if (!CurtainDesign.m_UserMainGUI.GetOrderInfo().getIsBoard()) {
       if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetVaneType() == -1)
       {
         return false;
       }
       if (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetPullBarType() == -1)
       {
         return false;
       }
       if ((!CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum())) && (!CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum().equals("0")) && (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerType() == -1))
       {
         return false;
       }
       if ((!CurtainChecker.isEmpty(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum())) && (Integer.parseInt(CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDividerNum()) > 0) && (CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDivederPos().equals("")))
       {
         return false;
       }
     }
     return true;
   }

   public void InputDividerPosDlg(boolean numchanged)
   {
     this.m_DividerPosDlg = new JDialog(CurtainDesign.m_UserMainGUI, "请输入分隔梁位置", true);
     InitDividerPosDlg(numchanged);
     this.m_DividerPosDlg.addWindowListener(new WindowListener()
     {
       public void windowActivated(WindowEvent e)
       {
       }

       public void windowClosed(WindowEvent e)
       {
       }

       public void windowClosing(WindowEvent e)
       {
         OrderInfoByFoldView.this.m_DividerPosDlg.dispose();
         CurtainDesign.m_UserMainGUI.show();
       }

       public void windowDeactivated(WindowEvent e)
       {
       }

       public void windowDeiconified(WindowEvent e)
       {
       }

       public void windowIconified(WindowEvent e)
       {
       }

       public void windowOpened(WindowEvent e)
       {
       }
     });
     this.m_DividerPosDlg.show();
   }

   private void InitDividerPosDlg(boolean numchanged)
   {
     JPanel contentpane = (JPanel)this.m_DividerPosDlg.getContentPane();
     contentpane.setLayout(new BorderLayout());
     JPanel uppane = new JPanel();
     JPanel botpane = new JPanel();
     contentpane.add(uppane, "Center");
     contentpane.add(botpane, "South");

     GridBagLayout gbl = new GridBagLayout();
     GridBagConstraints gbc = new GridBagConstraints();
     gbc.fill = 2;
     gbc.anchor = 13;
     gbc.insets = new Insets(15, 15, 15, 15);
     uppane.setLayout(gbl);

     String str = (String)this.m_DividerNum.getSelectedItem();
     Integer Count = new Integer(str);
     int count = Count.intValue();
     JLabel[] labels = new JLabel[count];
     JTextField[] pos = new JTextField[count];
     JButton okbt = new JButton("确定");
     JButton cancelbt = new JButton("取消");
     if (numchanged) {
       CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerPos("");
     }
     String tmp = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetDivederPos().replaceAll(" ", "");

     String[] storedpos = new String[tmp.split(",").length];
     storedpos = tmp.split(",");
     JLabel promotion = new JLabel("请从小到大，依次输入从窗户外框下端开始的分隔梁位置");
     promotion.setFont(new Font("Dialog", 0, 13));
     promotion.setForeground(Color.BLUE);
     gbc.gridwidth = 0;
     gbc.ipadx = 5;
     gbc.ipady = 5;
     gbl.setConstraints(promotion, gbc);
     uppane.add(promotion);

     for (int i = 0; i < count; i++) {
       labels[i] = new JLabel("分隔梁位置" + (i + 1) + "(mm):");
       labels[i].setFont(new Font("Dialog", 0, 13));
       gbc.gridwidth = 1;
       gbc.ipadx = 5;
       gbc.ipady = 0;
       gbl.setConstraints(labels[i], gbc);
       uppane.add(labels[i]);
       if (numchanged) {
         pos[i] = new JTextField("");
       }
       else if (tmp.equals("")) {
         pos[i] = new JTextField("");
       }
       else {
         pos[i] = new JTextField(storedpos[i]);
       }

       pos[i].setFont(new Font("Dialog", 0, 13));
       gbc.gridwidth = 0;
       gbc.ipadx = 150;
       gbc.ipady = 0;
       gbl.setConstraints(pos[i], gbc);
       uppane.add(pos[i]);
       pos[i].addKeyListener(new KeyListener()
       {
         Pattern numpattern = Pattern.compile("([0-9]*)(\\.)?([0-9]*)");

         public void keyTyped(KeyEvent e)
         {
         }

         public void keyReleased(KeyEvent e)
         {
           JTextField txt = (JTextField)(JTextField)e.getSource();
           String str = txt.getText();
           Matcher m = this.numpattern.matcher(str);
           if (!m.matches()) {
             OrderInfoByFoldView.this.getToolkit().beep();
             e.consume();
             JOptionPane.showMessageDialog(null, "请仅输入数字", "错误", 0);
             str = str.substring(0, str.length() - 1);
             txt.setText(str);
           }
         }

         public void keyPressed(KeyEvent e)
         {
         }
       });
     }
     botpane.setLayout(new FlowLayout());
     okbt.setFont(new Font("Dialog", 0, 13));
     cancelbt.setFont(new Font("Dialog", 0, 13));
     botpane.add(okbt);
     botpane.add(cancelbt);

     Dimension outframesize = CurtainDesign.m_UserMainGUI.getSize();
     Dimension size = new Dimension();
     size = this.m_DividerPosDlg.getPreferredSize();
     this.m_DividerPosDlg.setSize(size);
     int x0 = CurtainDesign.m_UserMainGUI.getX();
     int y0 = CurtainDesign.m_UserMainGUI.getY();
	   this.m_DividerPosDlg.setLocation(x0 + (outframesize.width - size.width) / 2, y0 + (outframesize.height - size.height) / 2);

//     okbt.addActionListener(new ActionListener(count, pos) {
//     	private final int val$count;
//       private final JTextField[] val$pos;
//
//       public void actionPerformed(ActionEvent ae) {
//       	String posstr = "";
//         for (int i = 0; i < this.val$count; i++) {
//           if (this.val$pos[i].getText().toString().equals("")) {
//             JOptionPane.showMessageDialog(null, "分隔梁位置不能为空！", "错误", 0);
//             return;
//           }
//           if (i < this.val$count - 1) {
//             posstr = posstr + this.val$pos[i].getText() + ",   ";
//           }
//           else {
//             posstr = posstr + this.val$pos[i].getText();
//           }
//         }
//         Float[] tmpInt = new Float[this.val$count];
//         for (int i = 0; i < this.val$count; i++) {
//           tmpInt[i] = new Float(this.val$pos[i].getText());
//         }
//         for (int i = 0; i < this.val$count - 1; i++) {
//           if (tmpInt[i].compareTo(tmpInt[(i + 1)]) >= 0) {
//             JOptionPane.showMessageDialog(null, "第" + (i + 1) + "个分隔梁位置必须小于第" + (i + 2) + "个分隔梁位置，请重新输入", "错误", 0);
//             return;
//           }
//         }
//
//         CurtainDesign.m_UserMainGUI.GetOrderInfo().SaveDividerPos(posstr);
//         OrderInfoByFoldView.this.m_DividerPos.setText(posstr);
//         OrderInfoByFoldView.this.m_DividerPos.setEnabled(true);
//         OrderInfoByFoldView.this.m_DividerPos.setEditable(false);
//         OrderInfoByFoldView.this.m_DividerPosDlg.dispose();
//         CurtainDesign.m_UserMainGUI.show();
//         OrderInfoByFoldView.this.CheckCalcBt();
//       }
//     });
     cancelbt.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent ae)
       {
         OrderInfoByFoldView.this.m_DividerPosDlg.dispose();
         CurtainDesign.m_UserMainGUI.show();
         OrderInfoByFoldView.this.CheckCalcBt();
       }
     });
   }
 }

/* Location:           C:\Users\Administrator\Desktop\奥特百叶窗\Shutter DesignerV3.1\CurtainDesign.jar
 * Qualified Name:     CurtainDesign.OrderInfoByFoldView
 * JD-Core Version:    0.6.0
 */